package com.hdax.dm.common;


import lombok.Getter;

@Getter
public class CommonResponse<T> {

    private String success;
    private String errorCode;
    private String msg;
    private T data;

    private static final String successCode="0000";

    public CommonResponse(){

    }

    //成功响应数据1
    public CommonResponse(String msg){
        this.success="success";
        this.errorCode=successCode;
        this.msg=msg;
    }
    //成功响应数据1
    public CommonResponse(String msg,T data){
        this.success="success";
        this.errorCode=successCode;
        this.msg=msg;
        this.data=data;
    }

    /**
     * 成功响应数据
     * @param data
     */
    public CommonResponse(T data){
        this.success="success";
        this.errorCode=successCode;
        this.data=data;
        this.msg="success";
    }
}
